using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

using SchemaProvider;

namespace OracleSchemaProvider
{
    public class OracleTableCodeProvider : TableCodeProviderBase
    {
        public override string MapClassAttribute(string tableName)
        {
            string owner;
            string entityName=CodeUtility.FilterOwner(tableName, out owner);
            if (string.IsNullOrEmpty(owner))
            {
                return "[Table(TableName = \"" + tableName + 
                    "\",IdSequence=\"SEQ_" + tableName + "\")]";
            }
            else
            {
                return "[Table(TableName = \"" + tableName +
                    "\",IdSequence=\"" + owner + ".SEQ_" + entityName + "\")]";
            }
        }

        public override string ToPropertyName(string parameterName)
        {
            return CodeUtility.BlockCaseToPascalCase(parameterName);
        }

        public override string MapClassName(string tableName)
        {
            tableName = CodeUtility.FilterOwner(tableName);
            return CodeUtility.BlockCaseToPascalCase(tableName);
        }
    }
}
